<template>
	<view class="zai-box">
		<image src="../../static/image/login.png" mode='aspectFit' class="zai-logo"></image>
		<view class="zai-title">智慧医疗</view>
		<view class="zai-form">
			<input class="zai-input" placeholder-class placeholder="请输入用户名" v-module="name" />
			<input class="zai-input" placeholder-class password placeholder="请输入密码" v-module="password" />
			<input class="zai-input" placeholder-class password placeholder="请再输入一次密码" v-module="passwordAgain" />
			<button class="zai-btn" @click="register">立即注册</button>
			<navigator url="../../pages/my/my" open-type='navigateBack' hover-class="none" class="zai-label">已有账号，点此去登录.
			</navigator>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				name: '',
				password: '',
				passwordAgain: ''
			}
		},
		methods: {
			register() {
				if (this.name == null) {
					wx.showToast({
						title: '用户名不能为空',
						icon: 'success',
						duration: 2000
					})
				} else if (this.password == null) {
					wx.showToast({
						title: '密码不能为空',
						icon: 'success',
						duration: 2000
					})
				} else if (this.passwordAgain == null) {
					wx.showToast({
						title: '请再次输入密码',
						icon: 'success',
						duration: 2000
					})

				} else if (this.password != this.passwordAgain) {
					wx.showToast({
						title: '两年输入的密码不一致',
						icon: 'none',
						duration: 2000
					})
				}
				console.log(5555);
			}
		}
	}
</script>

<style>
	.zai-box {
		padding: 0 100upx;
		position: relative;
	}

	.zai-logo {
		width: 100%;
		width: 100%;
		height: 310upx;
	}

	.zai-title {
		position: absolute;
		top: 0;
		line-height: 360upx;
		font-size: 68upx;
		color: #fff;
		text-align: center;
		width: 100%;
		margin-left: -100upx;
	}

	.zai-form {
		margin-top: 300upx;
	}

	.zai-input {
		background: #e2f5fc;
		margin-top: 30upx;
		border-radius: 100upx;
		padding: 20upx 40upx;
		font-size: 36upx;
	}

	.input-placeholder,
	.zai-input {
		color: #94afce;
	}

	.zai-label {
		padding: 60upx 0;
		text-align: center;
		font-size: 30upx;
		color: #a7b6d0;
	}

	.zai-btn {
		background: #ff65a3;
		color: #fff;
		border: 0;
		border-radius: 100upx;
		font-size: 36upx;
		margin-top: 60upx;
	}

	.zai-btn:after {
		border: 0;
	}

	/*按钮点击效果*/
	.zai-btn.button-hover {
		transform: translate(1upx, 1upx);
	}
</style>